package com.mapper;

import com.pojo.IClass;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * @author HP
 * @description 针对表【c_class】的数据库操作Mapper
 * @createDate 2024-11-18 11:05:20
 * @Entity com.pojo.IClass
 */
public interface IClassMapper {

    int deleteByPrimaryKey(Long id);

    int insert(IClass record);

    int insertSelective(IClass record);

    IClass selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(IClass record);

    int updateByPrimaryKey(IClass record);

    @Select("select * from c_class where id=#{id} ")
    @Results({@Result(id = true, column = "id", property = "id"),
            @Result(column = "classname", property = "classname"),
            @Result(column = "id", property = "studentList",
                    many = @Many(select = "com.mapper.IStudentMapper.selectStudentByCid"))})
    IClass selectClassById(int id);
}